import React from "react";

// NavLink具有Link的跳转功能，还多具备一个高亮的功能
import { NavLink, Routes, Route } from "react-router-dom";
import "./07-style.css";

const Home = () => {
  return <div>这是首页</div>;
};
const About = () => {
  return <div>这是关于页</div>;
};

const App = () => {
  return (
    <>
      <h2>导航高亮</h2>
      <ul>
        <li>
          <NavLink to="/home">首页</NavLink>
        </li>
      </ul>
      <ul>
        <li>
          <NavLink to="/about">关于页</NavLink>
        </li>
      </ul>

      <hr />

      <Routes>
        <Route path="/home" element={<Home />}></Route>
        <Route path="/about" element={<About />}></Route>
      </Routes>
    </>
  );
};

export default App;
